home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_09_07
/
9n07108a
< prev
next >
Wrap
Text File
|
1991-05-26
|
716b
|
48 lines
#include <stdio.h>
#include <signal.h>
#define RET_VALUE 0
#define TRUE 1
main(argc,argv)
int argc;
char **argv;è {
process(argc,argv);
exit(RET_VALUE);
}
process(argc,argv)
int argc;
char **argv;
{
int pid;
int status;
int ret;
signal(SIGINT,SIG_IGN); /* Ignore interrupt key */
pid = fork();
if (pid == -1)
{
perror("all_true");
exit(1);
}
if (pid > 0 )
{
/* In parent */
/* Wait for child */
ret = wait(&status);
if (ret == -1)
perror("all_true");
return;
}
/* In child */
argv++; /* Point to program argument */
signal(SIGINT,SIG_DFL); /* Ignore interrupt key */
execvp(*argv, argv);
perror("all_true");
}